﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using PureMVC.Interfaces;
using PureMVC.Patterns;
using SMS.Core.Model.Data;
using SMS.Core.View;

namespace SMS.Core.Controller.Commands
{
    class StartupCommand : SimpleCommand, ICommand
    {
        #region ICommand

        public new void Execute(INotification notification)
        {
            switch (notification.Name)
            {
                case ApplicationConstants.STARTUP:
                    if (Facade.RetrieveMediator(StartupMediator.NAME) == null)
                        Facade.RegisterMediator(new StartupMediator(notification.Body as Form));
                    break;
                case ApplicationConstants.STARTUP_SUCCESS:
                    Facade.RegisterMediator(new ConnectionMediator(notification.Body as UserControl));
                    break;
            }
        }

        #endregion
    }
}
